#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_btn_cal_clicked()
{
    QString num = ui->le_num->text();
    QString price = ui->le_price->text();
    float sum = num.toInt() * price.toFloat();
    ui->le_sum->setText(QString::asprintf("%.2f", double(sum)));
}

